package com.example.designpatterns.state;

/**
 * PendingPaymentState类 - 待付款状态
 * 
 * 实现与待付款状态相关的行为
 */
public class PendingPaymentState implements State {
    @Override
    public void pay(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已支付，等待发货");
        context.setState(new PendingShipmentState());
    }
    
    @Override
    public void ship(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 待付款，无法发货");
    }
    
    @Override
    public void receive(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 待付款，无法确认收货");
    }
    
    @Override
    public void refund(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 待付款，无需退款");
    }
    
    @Override
    public void cancel(Context context) {
        System.out.println("订单 " + context.getOrderNumber() + " 已取消");
        context.setState(new CancelledState());
    }
    
    @Override
    public String getDescription() {
        return "待付款";
    }
} 